import request from '@/utils/request'

// 获得列表
/* 
  @ param  any
     作为需要向后端传递的参数
     注意 get param
         post  body
*/
let getTicket = async (params) => {
    let result = await request({
        method: 'GET',
        url: '/ticket/getTicketList',
        params: {
            ...params,
            role: "ticket"
        }
    })
    return result
}

let delTicket = async (params) => {
    let result = await request({
        method: 'post',
        url: '/ticket/delTicketById',
        data: {
            ...params,
            role: "ticket"
        }
    })
    return result
}

let updateTicket = async (params) => {
    let result = await request({
        method: 'post',
        url: '/ticket/updateTicket',
        data: {
            ...params,
            role: "ticket"
        }
    })
    return result
}

let addTicket = async (params) => {
    let result = await request({
        method: 'post',
        url: '/ticket/addTicket',
        data: {
            ...params,
            role: "ticket"
        }
    })
    return result
}
// findTicketByplace
let findTicketByplace = async (params) => {
    let result = await request({
        method: 'post',
        url: '/ticket/findTicketByplace',
        data: {
            ...params,
        }
    })
    return result
}
export default {
    getTicket,
    delTicket,
    updateTicket,
    addTicket,
    findTicketByplace
}